home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 7: Sunsite
/
Linux Cubed Series 7 - Sunsite Vol 1.iso
/
system
/
admin
/
admin-v1.000
/
admin-v1
/
README.login
< prev
next >
Wrap
Text File
|
1995-05-20
|
591b
|
28 lines
This routine adds some help in tracking users.
Add the following to your /etc/profile:
---BEGIN---
# track login
USER=`whoami`
LOGNAME=`logname`
TTY=`tty`
export USER LOGNAME TTY
echo "LOGIN .$LOGNAME.$TTY.`date`" >> /usr/adm/logins
trap 1 2 3 # signals are restored
#
# set the trap for logout
#
trap "/sbin/checkout $LOGNAME $TTY" 0
---END---
You can see all it does is to build a new logfile called logins, writes
the username, tty and date of login.
Then when they exit it calls a script called `checkout` and writes the same
information with updated date/time.
Emmett Sauer